# 返回的对象是HttpResponse类的对象
from django.http import HttpResponse


def page_2102(request):
    return HttpResponse('来啦老弟')


def page_2103(requset):
    return HttpResponse('<h1>走了，老姐</h1>')


def index(request):
    return HttpResponse('<h1>这是我的首页</h1>')


# def page_1(request):
#     return HttpResponse('<h1>这是编号为1的网页</h1>')
#
# def page_2(request):
#     return HttpResponse('<h1>这是编号为2的网页</h1>')


def page_num(requeset, num):
    return HttpResponse('<h1>这是编号为%s的网页</h1>' % num)


def page_str(request, strinfo):
    return HttpResponse('<h1>变量值：%s</h1>' % strinfo)


def mm(request, num1, op, num2):
    if op == 'add':
        return HttpResponse('%s加%s等于%s' % (num1, num2, num1 + num2))
    elif op == 'sub':
        return HttpResponse('%s加%s等于%s' % (num1, num2, num1 - num2))
    elif op == 'mul':
        return HttpResponse('%s加%s等于%s' % (num1, num2, num1 * num2))
    else:
        return HttpResponse('<h1>输入错误</h1>')


def birthday_view(request,year,month,day):
    return HttpResponse('<h1>您的生日是%s年%s月%s日</h1>'%(year,month,day))